<template>
    <BasicModal v-bind="$attrs" wrapClassName="approval-form-modal" :destroyOnClose="true" :footer="null"
        :title="props.isUpdate ? '修改' : '新增'" :width="896" :canFullscreen="true" :defaultFullscreen="true"
        @register="registerApprovalModal">
        <div style="width: 100%; height: 100%; padding: 16px;">
            <ModalContext :modelDetail="{}"/>
        </div>
    </BasicModal>
</template>
<script setup lang="ts">
import { BasicModal, useModal } from '@/components/Modal';
import ModalContext from './modal-context.vue';

const [registerApprovalModal, { openModal, closeModal }] = useModal();

// 定义props
const props = defineProps({
    isUpdate: {
        default: false,
        type: Boolean
    },
    detail: {
        default: () => { },
        type: Object
    }
})

// 暴露openModal方法给父组件
defineExpose({
    openModal
});

</script>
<style lang="less">
@import '/@/design/reference/form.less';

.approval-form-modal {

    :deep(.ant-modal-body) {
        padding: 16px !important;
    }

    :deep(.ant-input-number) {
        width: 100%;
    }

    :deep(.ant-calendar-picker) {
        width: 100%;
    }
}
</style>